<?php
/*
Module:		Quotes
Version:	20071128a-DAT
File:		run.php
*/

if(strtoupper($args[0]) == '!SCRUBS')
{//!scrubs
	cmd_send(prep_text("Scrubs-Quote", getquote($CONFIG['scrubs-file'])));
}//!scrubs
if(strtoupper($args[0]) == '!ADDFACT')
{//!addfact
	addfact($con['buffer']['username'].': '.implode(array_slice($args,1),' '));
	cmd_send(prep_text("Notiz", "fact wurde ergaenzt"));
}//!addfact

if(strtoupper($args[0]) == '!FACT')
{//!fact
	cmd_send(prep_text("Fact", getquote($CONFIG['fact-file'])));
}//!fact	

if(strtoupper($args[0]) == '!KINDER')
{//!Kinder
	cmd_send(prep_text("Spruch", getquote($CONFIG['kinder-file'])));
}//!Kalauer

if(strtoupper($args[0]) == '!KALAUER')
{//!Kinder
	cmd_send(prep_text("Kalauer", getquote($CONFIG['kalauer-file'])));
}//!Kalauer	

if(strtoupper($args[0]) == '!FLIRT')
{//!flirt
	if (count($args) < 2)
	{
		cmd_send(prep_text("",$con['buffer']['username'].': '.getquote($CONFIG['flirt-file'])));
   	}
   	else	cmd_send(prep_text("",implode(array_slice($args,1)).': '.getquote($CONFIG['flirt-file'])));
}//!flirt

if(strtoupper($args[0]) == '!QFLIRT')
{//!qflirt
	if (count($args) < 2)
	{
		cmd_send(prep_text("Query Flirt",'Syntax: !QFlirt <chan/username> [<aditional text>] (Example: !QFlirt #irclove Sandra22ZP:)'));
	}
	else	cmd_send('PRIVMSG '.$args[1].' :'.implode(array_slice($args,2),' ').' '.getquote($CONFIG['flirt-file']));
}//!qflirt  	

if(strtoupper($args[0]) == '!TRIVIA')
{//!trivia
	cmd_send(prep_text("Trivia",getquote($CONFIG['trivia-file'])));
}//!trivia

if(strtoupper($args[0]) == '!WQ')
{//!wq
	if (count($args) < 2)
	{
		cmd_send(prep_text("",$con['buffer']['username'].': '.getquote($CONFIG['wq-file'])));
	}
	else	cmd_send(prep_text("",implode(array_slice($args,1)).': '.getquote($CONFIG['wq-file'])));
}//!wq
	
if(strtoupper($args[0]) == '!QWQ')
{//!qwq
	if (count($args) < 2)
	{
		cmd_send(prep_text("Query WarQuote",'Syntax: !QWQ <chan/username> [<aditional text>] (Example: !QWQ #irclove profmakx:)'));
	}
	else	cmd_send('PRIVMSG '.$args[1].' :'.implode(array_slice($args,2),' ').' :'.getquote($CONFIG['wq-file']));
}//!qwq  	
	
if(strtoupper($args[0]) == '!DUEL')
{//!duel
	if (count($args) < 2)
	{
		cmd_send(prep_text("Duell", 'Syntax: !duel <Opfer zum Niedermetzeln>'));
	}
	else
	{
		cmd_send(prep_text("Duell", $con['buffer']['username'].' will sich mit '.$args[1].' duellieren.'));
		cmd_send(prep_text("Waffenwahl", $con['buffer']['username'].' erhaellt '.getquote($CONFIG['weapon-file'])));
		cmd_send(prep_text("Waffenwahl", $args[1].' erhaellt '.getquote($CONFIG['weapon-file'])));
		cmd_send(prep_text("Duell", 'Moege der Bessere gewinnen!'));
	}
}//!duel	

//register commands 
if(strtoupper($args[0]) == "!COMMANDS")
{
	$COMMANDS=$COMMANDS.", !SCRUBS, !ADDFACT, !FACT, !FLIRT, !QFLIRT, !TRIVIA, !WQ, !QWQ, !DUEL, !KINDER, !KALAUER";
}



?>
